//
//  ViewController.m
//  DecoratorPattern
//
//  Created by 颖 on 2016/12/20.
//  Copyright © 2016年 ying. All rights reserved.
//

#import "ViewController.h"
#import "WYXBeverage.h"
#import "WYXEspresso.h"
#import "WYXMilk.h"
#import "WYXHouseBlend.h"
#import "WYXSoy.h"
#import "WYXWhip.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    // 一杯浓缩咖啡
    WYXBeverage *espresso = [[WYXEspresso alloc] init];
    // 加奶
    espresso = [[WYXMilk alloc] initWithBeverage:espresso];
    NSLog(@"%@",espresso.descriptionBeverage);
    NSLog(@"%f",espresso.cost);
    
    // 一杯混合咖啡
    WYXBeverage *houseblend = [[WYXHouseBlend alloc] init];
    // 加奶
    houseblend = [[WYXMilk alloc] initWithBeverage:houseblend];
    // 加豆浆
    houseblend = [[WYXSoy alloc] initWithBeverage:houseblend];
    // 加奶泡
    houseblend = [[WYXWhip alloc] initWithBeverage:houseblend];
    NSLog(@"%@",houseblend.descriptionBeverage);
    NSLog(@"%f",houseblend.cost);
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
